<template>
    <div id="data-view">
        <dv-full-screen-container>
            <topHeader @placeChange="placeChange" @finish="finish" />
            <dv-border-box-1 class="main-container">
                <dv-border-box-3 class="left-chart-container">
                    <!-- <leftTotalStat /> -->
                    <leftContent @placeChange="placeChange" @finish="finish" />
                </dv-border-box-3>
                <div class="right-chart-contrainer">
                    <dv-border-box-10 class="top">
                        <topStat :placeId="placeId" @finish="finish" />
                    </dv-border-box-10>
                    <div class="bottom">
                        <companyList :placeId="placeId" @finish="finish" />
                    </div>
                </div>
            </dv-border-box-1>
            <bottomFooter />
        </dv-full-screen-container>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import topHeader from './topHeader'
// import leftTotalStat from './leftTotalStat'
import leftContent from './scrollBoard'
import bottomFooter from '../bottomFooter'
import topStat from '../topStat'
import companyList from './companyList'
import { ElLoading } from 'element-plus'

const placeId = ref('')
const count = ref(0)
const loadingInstance = ElLoading.service({
    fullscreen: true,
})

const placeChange = e => {
    placeId.value = e
}

const finish = () => {
    count.value++
    if (count.value == 4) {
        loadingInstance.close()
    }
}
</script>

<style lang="less">
#data-view {
    width: 100%;
    height: 100%;
    background-color: #030409;
    color: #fff;

    #dv-full-screen-container {
        background-image: url('../img/bg.png');
        background-size: 100% 100%;
        box-shadow: 0 0 3px blue;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .block-left-right-content {
        flex: 1;
        display: flex;
        margin-top: 20px;
    }

    .block-top-bottom-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        padding-left: 20px;
    }

    .block-top-content {
        height: 55%;
        display: flex;
        flex-grow: 0;
        box-sizing: border-box;
        padding-bottom: 20px;
    }

    .main-container {
        height: calc(100vh - 130px);

        .border-box-content {
            padding: 20px;
            box-sizing: border-box;
            display: flex;
        }
    }
    .left-chart-container {
        width: 22%;
        padding: 10px;
        box-sizing: border-box;
        height: 100%;

        .border-box-content {
            flex-direction: column;
        }
    }

    .right-chart-contrainer {
        width: 78%;
        padding: 10px;
        box-sizing: border-box;
        height: 100%;
        display: flex;
        flex-direction: column;

        .top {
            height: 250px;
            margin-bottom: 5px;
            width: 100%;
            display: flex;
            flex-direction: row;
        }

        .bottom {
            height: calc(100% - 250px);
            width: 100%;
            display: flex;
            flex-direction: column;
        }
    }
}
</style>
